package org.blog.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel(value = "文章表")
@TableName(value = "blog_essay")
public class BlogEssay extends BaseColumn {
    @ApiModelProperty(value = "文章表主键")
    @TableId(value = "id")
    private String id;

    @ApiModelProperty(value = "文章标题")
    @TableField(value = "essay_title")
    private String essayTitle;

    @ApiModelProperty(value = "作者id（用户id）")
    @TableField(value = "author_id")
    private String authorId;

    @ApiModelProperty(value = "作者（用户昵称）")
    @TableField(value = "author")
    private String author;

    @ApiModelProperty(value = "文章摘要")
    @TableField(value = "summary")
    private String summary;

    @ApiModelProperty(value = "文章内容，富文本")
    @TableField(value = "essay_content")
    private String essayContent;

    @ApiModelProperty(value = "文章分类id")
    @TableField(value = "category_id")
    private String categoryId;

    @ApiModelProperty(value = "浏览量")
    @TableField(value = "view_count")
    private Long viewCount;

    @ApiModelProperty(value = "封面图片")
    @TableField(value = "cover_image")
    private String coverImage;

    @ApiModelProperty(value = "文章状态，0：草稿中，1：已发布，2：已下架")
    @TableField(value = "essay_status")
    private Integer essayStatus;

    @ApiModelProperty(value = "发布时间，文章状态为已发布时，必填")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "published_at")
    private Date publishedAt;
}

